#!/bin/bash

cd $(dirname $0)

# clean public/ directory
rm -Rf public
mkdir public

# build blog to public/
hugo -D -t LoveIt

# push blog to gitee-pages
cd public
git init 
git add -A
git commit -m "compiled at `date '+%Y-%m-%d %H:%M:%S'`"
git remote add origin git@gitee.com:amath0312/amath0312.git
git push -f -u origin master

# upload indexes to algolia
npm install
npm run algolia

